package life;



import javax.imageio.ImageIO;
import javax.swing.*;//for JFrame and JLabel etc

import java.awt.*;
import java.awt.image.BufferedImage;

import java.io.*;//for catch (IOException e),File,InputStream, BufferedInputStream,and FileInputStream ect


//国庆快乐
public class NationalDay extends JFrame {
    static BufferedImage image = null;
    static File file = null;

    public static void main(String[] args) throws Exception {

        try {
            file = new File("E:\\program_WorkSpace\\school\\language\\java\\javaSE\\src\\life\\source.jpg");
            image = ImageIO.read(file);
        } catch (IOException e) {
            System.out.println(e);
        }
        new NationalDay();
        System.out.println(image);

    }

    public NationalDay() {
        setSize(300, 200);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    @Override
    public void paint(Graphics g) {
        super.paint(g);
        g.drawImage(image, 0, 0, null);
    }

}

